build:
	- cargo build --release --target=wasm32-unknown-unknown

create:
	../cmc/cmc client contract user create --gas-limit=10000000 --contract-name={name} --runtime-type=WASMER --byte-code-path=./target/wasm32-unknown-unknown/release/chainmaker_contract_{name}.wasm --version=1.0 --sdk-conf-path=../cmc/sdk_config_pk.yml --admin-key-file-paths=../cmc/admin/admin1/admin1.key,../cmc/admin/admin2/admin2.key,../cmc/admin/admin3/admin3.key --sync-result=true --params="{}"
	rm sdk.*

upgrade:
	../cmc/cmc client contract user upgrade --gas-limit=10000000 --contract-name={name} --runtime-type=WASMER --byte-code-path=./target/wasm32-unknown-unknown/release/chainmaker_contract_{name}.wasm --version=$(v) --sdk-conf-path=../cmc/sdk_config_pk.yml --admin-key-file-paths=../cmc/admin/admin1/admin1.key,../cmc/admin/admin2/admin2.key,../cmc/admin/admin3/admin3.key --sync-result=true --params="{}"
	sed -i '4c version = "$(v)"' Cargo.toml
	rm sdk.*